package model;
import model.interfaces.CompositeNode;
import model.interfaces.Node;

public class AndNode extends CompositeNode {
	
	public boolean hasChildren() {
		return ! this.childrenNodes.isEmpty();
	}
	
	public void addNode(Node node) {
		this.childrenNodes.add(node);
		node.setFather(this);
	}
	
	public boolean verify() {
		boolean result = true;
		
		for(Node node : childrenNodes) {
		    result = result && node.verify();		    
		}
		
		return result;
	}

}
